﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using base31.Services.Hub.Helpers;

namespace base31.Services.Hub.Models
{
    /// <summary>
    /// Keeps track of the current position in the bootstrap polling process.
    /// </summary>
    public class PollingMarker
    {
        public DateTime LastStart { get; set; }
        public DateTime NextStart { get; set; }

        /// <summary>
        /// Get the current PollingMarker
        /// </summary>
        /// <returns>Returns the current PollingMarker, creating it if it doesn't exist.</returns>
        public PollingMarker Get()
        {
            return null;
        }

        /// <summary>
        /// Returns True if the bootstrap polling should progress.
        /// May modify this PollingMarker to when the next polling should start.
        /// </summary>
        /// <param name="period">The poll period for bootstrapping. Default to POLLING_BOOTSTRAP_PERIOD</param>
        /// <returns>Returns True if the bootstrap polling should progress.</returns>
        public bool ShouldProgress(int period = Constants.POLLING_BOOTSTRAP_PERIOD)
        {
            return true;
        }
    }
}
